import { VUE_APP_RESOURCES_URL } from '@/config';
import { VUE_DOMAIN_TITLE, VUE_SHARE_IMG_URL } from '@/config'
export default {
	data() {
		return {
			share: {
				title: VUE_DOMAIN_TITLE,
				imageUrl: VUE_APP_RESOURCES_URL + VUE_SHARE_IMG_URL,	//图片大小建议500*400
			}
		}
	},
	onShareAppMessage(res) { //发送给朋友
		return {
			title: this.share.title,
			imageUrl: this.share.imageUrl,
			path: "/pages/home/index?spread="+uni.getStorageSync('uid'),	//分享默认打开是小程序首页
			success(res) {
				console.log('success(res)==', res);
				uni.showToast({
					title: '分享成功'
				})
			},
			fail(res) {
				console.log('fail(res)==', res);
				uni.showToast({
					title: '分享失败',
					icon: 'none'
				})
			}
		}
	},
	onShareTimeline(res) { //分享到朋友圈
		return {
			title: this.share.title,
			imageUrl: this.share.imageUrl,
			path: "/pages/home/index?spread="+uni.getStorageSync('uid'),	//分享默认打开是小程序首页
			success(res) {
				console.log('success(res)==', res);
				uni.showToast({
					title: '分享成功'
				})
			},
			fail(res) {
				console.log('fail(res)==', res);
				uni.showToast({
					title: '分享失败',
					icon: 'none'
				})
			}
		}
	},
}

